import { Module } from "@nestjs/common";
import { MongooseModule } from './mongoose.module';
import { MongooseConfigService } from "./mongoose-config.service";
import { UserSchema } from "@/examples/user/schema/user.schema";
import { MongooseRepository } from "@/examples/user/repositories/mongoose.repository";

@Module({
    imports: [
        // MongooseModule.forRoot('mongodb://localhost/nest_test'),
        MongooseModule.forRootAsync({
            useClass: MongooseConfigService
        }),
        MongooseModule.forFeature([{ name: 'User', schema: UserSchema }])
    ],
    providers: [MongooseRepository],
    exports: [MongooseModule, MongooseRepository]
})
export class MongooseCommonModule {

}